<template>
  <div>
    <el-button type="primary">{{ text }}</el-button>
    <el-button type="warning" @click="toVue3">跳转Vue3写法</el-button>
  </div>
</template>

<script>
import { useRouter } from 'vue-router'
export default {
  data() {
    return {
      text: '111',
      router: null
    }
  },
  methods: {
    toVue3() {
      this.router.push({
        path: '/home'
      })
    }
  },
  mounted() {
    this.router = useRouter()
  }
}
</script>

<style></style>
